package com.xzc.gulimall.order.controller;

import java.util.Arrays;
import java.util.Map;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.xzc.gulimall.order.entity.OrderCopy1Entity;
import com.xzc.gulimall.order.service.OrderCopy1Service;
import com.xzc.common.utils.PageUtils;
import com.xzc.common.utils.R;



/**
 * 订单
 *
 * @author xzc
 * @email 1936002261@qq.com
 * @date 2025-05-28 16:14:11
 */
@RestController
@RequestMapping("order/ordercopy1")
public class OrderCopy1Controller {
    @Autowired
    private OrderCopy1Service orderCopy1Service;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("order:ordercopy1:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = orderCopy1Service.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    //@RequiresPermissions("order:ordercopy1:info")
    public R info(@PathVariable("id") Long id){
		OrderCopy1Entity orderCopy1 = orderCopy1Service.getById(id);

        return R.ok().put("orderCopy1", orderCopy1);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("order:ordercopy1:save")
    public R save(@RequestBody OrderCopy1Entity orderCopy1){
		orderCopy1Service.save(orderCopy1);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //@RequiresPermissions("order:ordercopy1:update")
    public R update(@RequestBody OrderCopy1Entity orderCopy1){
		orderCopy1Service.updateById(orderCopy1);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("order:ordercopy1:delete")
    public R delete(@RequestBody Long[] ids){
		orderCopy1Service.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
